#include <iostream>

using namespace std;

struct student
{
    //成员列表

    //姓名
    string name;
    // 年龄
    int age;
    // 分数
    int score;
};
//将函数形参改为指针，可减少内存空间
void printstudents(const student *p)
{
    //p->age = 26;
    cout << "姓名：" << p->name << endl;
    cout << "年龄：" << p->age << endl;
    cout << "成绩：" << p->score << endl;
}

int main(void)
{
    struct student s = {"张三", 15, 70};

    printstudents(&s);

    cout << "main中张三年龄为：" << s.age << endl;

    return 0;
}